package com.yoku.article.service.impl;

import com.dubbo.annotation.Provider;
import com.yoku.article.manager.ArticleManager;
import com.yoku.article.model.Article;
import com.yoku.article.model.Tag;
import com.yoku.article.service.ArticleWriteService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * Desc:
 * Author: <a href="xiahj@terminus.io">xiahj</a>
 * Date: 2016/12/12
 */

@Provider
public class ArticleWriteServiceImpl implements ArticleWriteService {

    @Autowired
    private ArticleManager articleManager;


    @Override
    public Boolean saveArticleAndTag() {

        Article article = new Article(null, "java", "hello word");
        Tag tag = new Tag(3, "hello");
        Boolean isSuccess = articleManager.createArticleAndTag(article, tag);
        return isSuccess;
    }
}
